package com.hbnu.iostream;

import java.io.IOException;

/**
 * @author kittychen
 * @date 2025-09-30 17:42
 */
public class PipedStreamTest {
    public static void main(String[] args) {
        PipedInputStreamDemo pipedInputStreamDemo = new PipedInputStreamDemo();
        PipedOutputStreamDemo pipedOutputStreamDemo = new PipedOutputStreamDemo();

        try {
            pipedOutputStreamDemo.getPipedOutputStream().connect(pipedInputStreamDemo.getPipedInputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }

        new Thread(pipedInputStreamDemo).start();
        new Thread(pipedOutputStreamDemo).start();
    }
}
